namespace SilenthinkContract.Domain
{
    /// <summary>
    /// 订单明细
    /// </summary>
    public class OrderItem : BaseEntity<int>
    {
        public long UserId { get; set; }
        public string OrderId { get; set; }
        public long ProductId { get; set; }
        public string ProductName { get; set; }
        public string ProductVariantId { get; set; }
        public string ProductVariantName { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }
        /// <summary>
        /// 单价(对应ProductVariant里的VariantPrice)
        /// </summary>
        public decimal UnitPrice { get; set; }
        /// <summary>
        /// 折扣
        /// </summary>
        public decimal Discount { get; set; }
        public string ProductAttribute { get; set; }
        public string ProductAttributeXml { get; set; }
        public decimal SubTotal { get { return UnitPrice*Quantity - Discount; } }
        #region Navigation Properties
        ///// <summary>
        ///// 关联订单
        ///// </summary>
        //public virtual Order Order { get; set; }

        ///// <summary>
        ///// 关联礼品卡
        ///// </summary>
        //public virtual IList<GiftCard> AssociatedGiftCards { get; set; }
        #endregion
    }
}